/**
 * Created by yqj on 2017/2/20.
 */
const DictionaryModel = require('../models/dictionary-model.js');
const BookTypeModel = require('../models/dictionary-model.js');


const dictionaryController = {

    getBookType (params) {
        return new Promise((resolve, reject) => {
            BookTypeModel
                .find()
                .exec((error, docs) => {
                    if (error) {
                        reject({status: 500, message: '未知错误'})
                    }else {
                        resolve({
                            result: docs,
                            message: 'success'
                        })
                    }
                });
        });
    },
    getBrand (req, res) {
        let params = {};
        return dictionaryController
            .getBookType(params)
            .then((data) => {
                res.json({message: data.message, result: data.result});
            }, (err) => {
                res.status(err.status).json({message: err.message});
            })
    },
    getGrade (req, res) {

    },
    getProvinces (req, res) {

    },
    getSelfBuildContentType (req, res) {

    },
    getSeries (req, res) {

    },
    getSubjects (req, res) {

    },
    getTopicType (req, res) {

    },
    getVersion (req, res) {

    },
    getVolume (req, res) {

    }
};

module.exports = dictionaryController;